import request from "@/utils/request";

// 获取物料分类下拉列表
export function getcategoryCateListApi() {
  return request({
    url: "/system/categoryCate/list",
    method: "get",
  });
}

// 任务分配
export function allotListApi(data) {
  return request({
    url: "/system/materialTest/allot",
    method: "post",
    data
  });
}

// 根据责任人筛选查询表格
export function orderCntApi(data) {
  return request({
    url: "/system/materialTest/orderCnt",
    method: "post",
    data
  });
}

// 个人任务
export function getOrderCntDtlApi(query) {
  return request({
    url: "/system/materialTest/orderCntDtl",
    method: "get",
    params: query
  });
}

// 获取物料有没有早产品库众
export function getInfoApi(query) {
  return request({
    url: `/system/materialTest/getInfo`,
    method: "get",
    params: query
  });
}

// 获取评估产品列表
export function getproductListApi(query, data) {
  return request({
    url: "/system/product/assess/list",
    method: "post",
    params: query,
    data,
  });
}

//  新增/编辑/删除产品库-评估产品

// 新增assessId为null;
// 编辑assessId为选中的id, 需要回传;
// 删除同编辑, 逻辑删除只需要关注status修改为1即可;
export function getproductmodifyApi(data) {
  return request({
    url: `/system/product/assess/modify`,
    method: "post",
    data,
  });
}

// 获取物料信息列表
export function getmaterialListApi(query, data) {
  return request({
    url: "/system/material/list",
    method: "post",
    params: query,
    data,
  });
}

// 获取物料有没有早产品库众
export function getcheckproductApi(materialId) {
  return request({
    url: `/system/product/assess/judge/${materialId}`,
    method: "get",
  });
}

// 获取产品详情
export function getcheckproductdetailApi(assessId) {
  return request({
    url: `/system/product/assess/${assessId}`,
    method: "get",
  });
}

// 获取物料有没有在产品库id
export function getcheckproductidApi() {
  return request({
    url: `/system/product/assess/ListMaterialId`,
    method: "post",
  });
}

// 撤销产品评估
export function saveCancel(id) {
  return request({
    url: "/system/product/assess/saveCancel",
    method: "get",
    params: { id },
  });
}

// 审核进度
export function selectAuditList(deliveryApplyId) {
  return request({
    url: `/system/product/assess/selectAuditList`,
    method: "get",
    params: { deliveryApplyId },
  });
}

// 提交
export function checkProjectApi(data) {
  return request({
    url: "/system/project/check",
    method: "post",
    data,
  });
}


export function saveCheckTemp(data) {
  return request({
    url: `/system/product/assess/saveCheck`,
    method: "post",
    data,
  });
}

export function deleteOrder(id) {
  return request({
    url: "/system/product/assess/delete",
    method: "get",
    params: { id },
  });
}



// 获取测评列表
export function getTaskList(query, data) {
  return request({
    url: "/system/materialTest/getTaskList",
    method: "post",
    params: query,
    data,
  });
}

// 获取待测评列表
export function getNoTaskList(query, data) {
  return request({
    url: "/system/materialTest/getNoTaskList",
    method: "post",
    params: query,
    data,
  });
}

